package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	import quexi.components.Button;
	import quexi.components.List;
	import quexi.components.ListItem;
	
	public class LiteUI extends Sprite
	{
		private var list:List;
		private var textShow:TextField;
		
		public function LiteUI()
		{
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			
			list = new List();
			list.addItem({label:"asdfasd"});
			list.addItem({label:"okk"});
			list.addEventListener(Event.SELECT, onSelect);
			
			textShow = new TextField();
			textShow.x = 200;
			textShow.y = 100;
			
			
			var btn:Button = new Button();
			btn.x = 200;
			btn.y = 200;
			btn.addEventListener(MouseEvent.CLICK, onClick);
			
			addChild(btn);
			addChild(list);
			addChild(textShow);
		}
		
		private function onClick(e:MouseEvent):void
		{
			list.addItem({label:"asdfsds"});
		}
		
		private function onSelect(e:Event):void
		{
			textShow.text = list.selectedItem.label;
		}
		//
	}
}